﻿using System;
using System.Windows;
using System.Windows.Navigation;

namespace Bravura.Editing.Common.Dialogs
{
	/// <summary>
	/// Interaction logic for AboutWindow.xaml
	/// </summary>
	public partial class AboutWindow : Window
	{
		public AboutWindow()
		{
			InitializeComponent();
		}

		public string AppName
		{
			set { NameLabel.Content = value; }
		}

		public string AppVersion
		{
			set { VersionLabel.Content = "Version : " + value; }
		}

		public string AppLinkUri
		{
			set { AppLink.NavigateUri = new Uri(value); }
		}

		public string AppLinkText
		{
			set { AppLink.Inlines.Clear(); AppLink.Inlines.Add(value); }
		}

		private void Button_Click(object sender, RoutedEventArgs e)
		{
			this.Close();
		}

		private void AppLink_RequestNavigate(object sender, RequestNavigateEventArgs e)
		{
			Utilities.BrowseToWebPage(AppLink.NavigateUri);
			e.Handled = true;
		}
	}
}
